<%
    Users user = Trader.getUser(request.getParameter("uid"));
	wstrader.task.home.DailyBasis task = user.home.daily_basis;

	task.getRequest().setRequest(request);
	task.getResponse().setResponse(response,out);
	
	if (!user.Authenticated()) {
		response.sendRedirect("logon.jsp");
		return;
	}
	((Tasks)task.getOwner()).clearFocus();
	task.setFocus(true);	
	
	Trader.window_width = "100%";	
	
	int dLoop=0;
	ResultSet rs;
	java.sql.Date MonthOne = Utils.strToDate("01-" + Utils.dateToStr(Utils.today()).substring(3));
	java.sql.Date MonthTwo = Utils.nextMonth(MonthOne);
	java.sql.Date MonthThree = Utils.nextMonth(MonthTwo);	
	java.sql.Date MonthFour = Utils.nextMonth(MonthThree);
	java.sql.Date MonthFive = Utils.nextMonth(MonthFour);
	java.sql.Date MonthSix = Utils.nextMonth(MonthFive);
	java.sql.Date MonthSeven = Utils.nextMonth(MonthSix);
	java.sql.Date MonthEight = Utils.nextMonth(MonthSeven);
	java.sql.Date MonthNine = Utils.nextMonth(MonthEight);
	java.sql.Date MonthTen = Utils.nextMonth(MonthNine);
	java.sql.Date MonthEleven = Utils.nextMonth(MonthTen);
	java.sql.Date MonthTwelve = Utils.nextMonth(MonthEleven);									
	java.sql.Date MonthThirteen = Utils.nextMonth(MonthTwelve);
	
	String M_One = Utils.dateToStr(MonthOne).substring(3);
	String M_Two = Utils.dateToStr(MonthTwo).substring(3);
	String M_Three = Utils.dateToStr(MonthThree).substring(3);
	String M_Four = Utils.dateToStr(MonthFour).substring(3);
	String M_Five = Utils.dateToStr(MonthFive).substring(3);
	String M_Six = Utils.dateToStr(MonthSix).substring(3);
	String M_Seven = Utils.dateToStr(MonthSeven).substring(3);
	String M_Eight = Utils.dateToStr(MonthEight).substring(3);
	String M_Nine = Utils.dateToStr(MonthNine).substring(3);
	String M_Ten = Utils.dateToStr(MonthTen).substring(3);
	String M_Eleven = Utils.dateToStr(MonthEleven).substring(3);
	String M_Twelve = Utils.dateToStr(MonthTwelve).substring(3);
%>

<%@include file="../header.jsp"%><style type="text/css">
<!--
.style1 {
	font-family: Arial;
	font-size: 12px;
}
.style3 {font-weight: bold}
.style4 {font-family: Arial; font-size: 12px; font-weight: bold; }
.style5 {
	font-family: Arial;
	font-size: 10px;
}
-->
</style>

<script language="javascript">
function doAddNew_trd()
{
	var form = document.formMain;
	form.new_rec.value = "1";
	form.action = "home.physical.daily-basis.card.jsp";
	form.submit(); 
}

function doCboClick()
{
	var form = document.formMain;
	form.submit();
}

function selectRowCol(row)
{
	var id = row.id;
	var form = document.formMain;
	var len = (id).length;

	var loop=0;
	var Val ="";
	var Chk ="";
	var clen = 0;
	var grdid="";
	var chkdt ="";
	while (loop <= len)
	{
		clen = loop;
		Val = id.substring(clen);
		Chk = Val.substring(0,1);
		
		if (Chk=="+")
		{
			chkdt = id.substring(clen+1);
			form.grade.value = grdid;
			form.ls_date.value=chkdt;
			return
		}
		else
		{
			if (loop ==0) grdid = Chk
			if (loop > 0) grdid = grdid+Chk;
		}
		loop=loop+1;
	}
}

function opencontract(row,type)
{
	var form = document.formMain;
	form.otype.value = type;	
	form.action = "home.daily-basis.list.jsp";
	form.submit();	
}

function doReport()
{
	var form = document.formMain;
	doTask(5);
}
</script>
<form action="" method="post" name="formMain" id="formMain">
  <table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="4"><img src="images/trade-dailybasis.jpg" width="220" height="30"></td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
      <td width="2%">&nbsp;</td>
    </tr>
    <tr>
      <td width="1%">&nbsp;</td>
      <td width="4%">&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="style1"><strong>&nbsp;<span class="style3"><strong>Origin:</strong></span></strong></span></td>
      <td colspan="2"><select name="origin" id="origin" style="font-family:Arial; font-size:12; width:50%;" tabindex="4" onChange="doCboClick();">
		  		<option value="0" selected>All</option>	  
        <%
				task.getResponse().setOption(task.getMasterList("origin_master",true));
				task.getResponse().setSelected("origin");
				%>
      </select></td>
      <td><span class="style1"><span class="style3"><strong>Quality:</strong>
      </span></span></td>
      <td colspan="4"><select name="quality" id="quality" style="font-family:Arial; font-size:12; width:100%;" tabindex="5" onChange="doCboClick();">
        <%
				task.getResponse().setOption(task.getMasterList("quality_master",true));
				task.getResponse().setSelected("quality");
				%>
      </select></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td width="23%" align="center" valign="middle">&nbsp;</td>
      <td width="5%" align="center" valign="middle">&nbsp;</td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle"><strong></strong></td>
      <td align="center" valign="middle" class="style1 style3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="18">
            <div id=scroll1 style="BORDER:0px ; OVERFLOW: auto; WIDTH: 100%; HEIGHT: 260px;">
              <%@include file="home.daily-basis.offerlist.jsp"%>
          </div>	  
	  </td>
    </tr>
    <tr>
      <td><img src="images/new.gif" width="15" height="15" onClick="doAddNew_trd()"></td>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input name="new_rec" type="hidden" id="new_rec" value="0"></td>
      <td><input type="hidden" name="task_id"    id = "task_id"   value="0"></td>
      <td><input type="hidden" name="ls_date"        id="ls_date"       value="<%=new java.sql.Date(0)%>"></td>
      <td><input type="hidden" name="grade"        id="grade"       value="0"></td>
      <td><input type="hidden" name="uid"        id="uid"       value="<%=user.getuid()%>"></td>
      <td><input type="hidden" name="otype"        id="otype"       value="0"></td>
    </tr>
  </table>
</form>


<%@include file="../footer.jsp"%>